﻿<ResourceDictionary    
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:conv="clr-namespace:QuickZip.Converters"            
    xmlns:local="clr-namespace:QuickZip.UserControls"            
    xmlns:sys="clr-namespace:System;assembly=mscorlib" >

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/QuickZip.UserControls;component/Themes/Brushes.xaml" />
        <ResourceDictionary Source="pack://application:,,,/QuickZip.UserControls;component/Themes/Geometry.xaml" />
        <ResourceDictionary Source="pack://application:,,,/QuickZip.UserControls;component/Themes/Converters.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style x:Key="SimpleSliderRepeatButtonStyle" TargetType="{x:Type RepeatButton}">
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border Background="{TemplateBinding Background}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="SimpleHorizontalSliderThumbStyle" TargetType="{x:Type Thumb}">
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Foreground" Value="{x:Null}"/>
        <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Rectangle Opacity="0.5" Margin="-1" x:Name="ForegroundRect" Fill="Silver" Width="5" 
							VerticalAlignment="Stretch"/>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsDragging" Value="true">
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <ControlTemplate x:Key="SimpleSlider" TargetType="{x:Type Slider}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="0"/>
                <RowDefinition Height="3*"/>
                <RowDefinition Height="0"/>
            </Grid.RowDefinitions>            
            <Border Margin="0" BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}" 
				BorderThickness="1" Grid.RowSpan="1" Grid.Row="1" CornerRadius="3">
                <Grid>
                    <Rectangle Stroke="{TemplateBinding BorderBrush}" Margin="0" Fill="{TemplateBinding Background}" 
                               Opacity="0.7" />
                    <Canvas >
                        <Rectangle x:Name="PART_SelectionRange" Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" 
						Stroke="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" StrokeThickness="1.0" Height="4.0" Visibility="Hidden"/>
                    </Canvas>
                    <Track x:Name="PART_Track" >
                        <Track.DecreaseRepeatButton>
                            <RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{StaticResource SimpleSliderRepeatButtonStyle}"						
                                          Background="{TemplateBinding Foreground}" 
						HorizontalAlignment="Left" />
                        </Track.DecreaseRepeatButton>
                        <Track.IncreaseRepeatButton>
                            <RepeatButton  Command="{x:Static Slider.IncreaseLarge}" Style="{StaticResource SimpleSliderRepeatButtonStyle}"
						 HorizontalAlignment="Right" />
                        </Track.IncreaseRepeatButton>
                        <Track.Thumb>
                            <Thumb x:Name="Thumb" Style="{StaticResource SimpleHorizontalSliderThumbStyle}" />
                        </Track.Thumb>
                    </Track>
                </Grid>
            </Border>

        </Grid>
    </ControlTemplate>
    
    <!--<Trigger Property="IsSelectionRangeEnabled" Value="true">
                <Setter Property="Visibility" TargetName="PART_SelectionRange" Value="Visible"/>
            </Trigger>
            <Trigger Property="IsKeyboardFocused" Value="true">
                <Setter Property="Foreground" TargetName="Thumb" Value="Blue"/>
            </Trigger>-->


</ResourceDictionary>